package com.learn.dataandfile

import android.view.LayoutInflater
import com.exercise.struct.base.BaseActivity
import com.exercise.struct.viewmodel.BaseViewModel
import com.learn.dataandfile.databinding.ActivityMainBinding
import com.learn.dataandfile.media_files_from_multiple_folder.MediaFilesFromMultipleFolderActivity
import com.learn.dataandfile.share_storage.ShareStorageActivity
import com.learn.dataandfile.sharedpreferences.SharedPreferencesActivity

class MainActivity : BaseActivity<BaseViewModel, ActivityMainBinding>() {
    override val bindingInflater: (LayoutInflater) -> ActivityMainBinding
        get() = ActivityMainBinding::inflate
    override val modelClass: Class<BaseViewModel>
        get() = BaseViewModel::class.java

    override fun initData() {
    }

    override fun initView() {
        binding.titleBar.toolbar.title = "App data and files"
        binding.titleBar.toolbar.navigationIcon = null
        initListener()
    }

    private fun initListener() {
        binding.btnAppSpecificStorage.setOnClickListener {
            AppSpecificStorageActivity.start(this)
        }
        binding.btnShareStorage.setOnClickListener {
            ShareStorageActivity.start(this)
        }
        binding.btnSharePreferences.setOnClickListener {
            SharedPreferencesActivity.start(this)
        }
        binding.btnShowMediaFilesFromMultipleFolder.setOnClickListener {
            MediaFilesFromMultipleFolderActivity.start(this)
        }
    }

}